home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Toolbox
/
Visual Basic Toolbox (P.I.E.)(1996).ISO
/
gauge
/
odomvb25
/
vcview.cpp
< prev
next >
Wrap
C/C++ Source or Header
|
1996-01-20
|
2KB
|
119 lines
// vcview.cpp : implementation of the CVcView class
//
#include "stdafx.h"
#include "vc.h"
#include "vcdoc.h"
#include "vcview.h"
#ifdef _DEBUG
#undef THIS_FILE
static char BASED_CODE THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CVcView
IMPLEMENT_DYNCREATE(CVcView, CFormView)
BEGIN_MESSAGE_MAP(CVcView, CFormView)
//{{AFX_MSG_MAP(CVcView)
ON_WM_CREATE()
ON_WM_DESTROY()
ON_WM_TIMER()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CVcView construction/destruction
CVcView::CVcView()
: CFormView(CVcView::IDD)
{
//{{AFX_DATA_INIT(CVcView)
m_odom3 = NULL;
m_odom2 = NULL;
m_odom1 = NULL;
//}}AFX_DATA_INIT
// TODO: add construction code here
}
CVcView::~CVcView()
{
}
void CVcView::DoDataExchange(CDataExchange* pDX)
{
CFormView::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CVcView)
DDX_VBControl(pDX, IDC_ODOMETER3, m_odom3);
DDX_VBControl(pDX, IDC_ODOMETER2, m_odom2);
DDX_VBControl(pDX, IDC_ODOMETER1, m_odom1);
//}}AFX_DATA_MAP
SetTimer(1,55,NULL);
}
/////////////////////////////////////////////////////////////////////////////
// CVcView diagnostics
#ifdef _DEBUG
void CVcView::AssertValid() const
{
CFormView::AssertValid();
}
void CVcView::Dump(CDumpContext& dc) const
{
CFormView::Dump(dc);
}
CVcDoc* CVcView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CVcDoc)));
return (CVcDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CVcView message handlers
int CVcView::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CFormView::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
void CVcView::OnDestroy()
{
CFormView::OnDestroy();
KillTimer(1);
}
void CVcView::OnTimer(UINT nIDEvent)
{
float value;
value = m_odom1->GetFloatProperty("Value");
value+=(float) .002;
m_odom1->SetFloatProperty("Value",value);
value = m_odom2->GetFloatProperty("Value");
value+=(float) .002;
m_odom2->SetFloatProperty("Value",value);
value = m_odom3->GetFloatProperty("Value");
value+=(float) .002;
m_odom3->SetFloatProperty("Value",value);
CFormView::OnTimer(nIDEvent);
}